﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CanDoo.Core.Data;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——金额变动日志
    /// </summary>
    [Serializable]
    [Description("金额变动日志")]
    public class MoneyChange :  EntityBase,ICreatedTime, IAudited
    {
        /// <summary>
        ///用户
        /// </summary>
        [Display(Name = "用户")]
        public virtual User User { get; set; }
        /// <summary>
        ///用户外键
        /// </summary>
        [Display(Name = "用户外键")]
        public long? UserId { get; set; }

        /// <summary>
        ///收入/支付方式 0现金充值 1POS机支付 2微信支付 3支付宝支付 10取油 11更换取油码 12购买其他商品
        /// </summary>
        [Display(Name = "收入/支付方式 0现金充值 1POS机支付 2微信支付 3支付宝支付 10取油 11更换取油码 12购买其他商品")]
        [Required]
        public int MoneyType { get; set; }

        /// <summary>
        ///单据号
        /// </summary>
        [Display(Name = "单据号")]
        [StringLength(50)]
        public string Code { get; set; }

        /// <summary>
        ///关联消费单据
        /// </summary>
        [Display(Name = "关联消费单据")]
        [StringLength(50)]
        public string LingEntityId { get; set; }

        /// <summary>
        ///变动前
        /// </summary>
        [Display(Name = "变动前")]
        [Required]
        public double MoneyBefore { get; set; }

        /// <summary>
        ///变动后
        /// </summary>
        [Display(Name = "变动后")]
        [Required]
        public double MoneyAfter { get; set; }

        /// <summary>
        ///变动金额
        /// </summary>
        [Display(Name = "变动金额")]
        [Required]
        public double Money { get; set; }

        /// <summary>
        ///编组消费
        /// </summary>
        [Display(Name = "编组消费")]
        [StringLength(50)]
        public string GroupId { get; set; }

        
        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion
    }
}
